package com.lgq.bean;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: stu_info_manager
 * @description:
 * @author: Lin
 * @create: 2019-01-05 14:50
 **/
public class Message {
    /**
    状态码
     */
    private int code;
    /**
     * 返回信息
     */
    private String message;

    private Map<String,Object> extend=new HashMap<String,Object>();


    public static Message success(){
        Message message=new Message();
        message.setCode(100);
        message.setMessage("处理成功");
        return message;

    }

    public static Message fail(){
        Message message=new Message();
        message.setCode(200);
        message.setMessage("处理失败");
        return message;
    }

    public Message add(String key,Object value){
        this.getExtend().put(key,value);
        return this;

    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Map<String, Object> getExtend() {
        return extend;
    }

    public void setExtend(Map<String, Object> extend) {
        this.extend = extend;
    }
}
